package com.yamvc.mvc.model
{
	import com.yamvc.mvc.controller.Controller;
	
	import flash.events.Event;
	import flash.events.EventDispatcher;

	public class Proxy extends EventDispatcher
	{
		private var _data:Object;
		public function get data():Object{
			return _data;
		}
		public function set data(value:Object):void{
			_data = value;
			dispatchEvent(new ProxyEvent(ProxyEvent.PROXY_DATA_CHANGE,_data));
			Controller.instance.dispatchEvent(new ProxyEvent(ProxyEvent.PROXY_DATA_CHANGE,_data));
		}
		public function Proxy(data:Object=null){
			super();
			this.data = data;
		}
		
		public override function dispatchEvent(event:Event):Boolean{
			super.dispatchEvent(event);
			return Controller.instance.dispatchEvent(event);
		}
	}
}